import {
    api,
} from '@/lib/api';
import {
    url,
} from '@/lib/utils';

import { Module } from 'vuex';
import { RootState } from '@/types/store';
export interface FeedbackState {}

const m: Module<FeedbackState, RootState> = {
    namespaced: true,
    actions: {
        /**
         * 投诉
         */
        async complaint({ state, commit }, { name, mobile, content, images }) {
            const res = await api.post({
                url: `${url}/api/user/feedback`,
                data: {
                    name,
                    mobile,
                    content,
                    images,
                },
            });
            return res;
        },
    },
};

export default m;
